<?php
declare (strict_types = 1);

namespace app\index\controller;

use app\index\logic\IndexLogic;
use app\index\model\Banner;
use app\index\model\Goods;
use think\facade\View;

class Index
{
    public function index(){
        //where条件拼接
        $where=IndexLogic::goodWhere();
        //留值
        $data=IndexLogic::goodData();
        View::assign($data);
        $banner=Banner::bannerListInfo();
        View::assign('banner',$banner);
        list($list,$recom)=Goods::GoodsListInfo($where);
        View::assign('list',$list);
        View::assign('recom',$recom);
        return View::fetch();
    }
//    public function quzhi()
//    {
//        $arr1 = [ '0', '1', '2'];
//
//        $arr2=['橡皮','尺子','笔'];
//        foreach ($arr2 as $k=>$v){
//            echo "<pre>";
//            print_r($v);
//            echo "</pre>";
//        }
//    }
    public function dingzhi()
    {
        return View::fetch();
    }

}
